<template>
    <div class="box">
        <img @click="$router.go(-1)" src="/img/tx/back.png" alt="">
        <div class="top">
             <video autoplay controls :src="arr.playURL">
            </video>
            <p>{{arr.shareTitle}}</p>
        </div>
        <div v-for="(v,i) in introduces" :key="i">
            <div>
                <p class="intro">【{{v.title}}】</p>
                <div v-html="v.introduce">{{v.introduce}}</div>
            </div>
        </div>
    </div>

</template>
<script>
export default {
    data() {
        return {
            courseId:0,
            arr:[],
            introduces:[]
        }
    },
    watch: {
    // 监测路由变化,只要变化了就调用获取路由参数方法将数据存储本组件即可
        $route(){
             this.data()
        }
    },
    mounted(){
        //  this.getParams();
         this.data()
    },
    activated:function(){
    // this.getParams();
    this.data();
    },
    methods:{
        data(){
            this.axios({
                url:"https://api.hongbeibang.com/education/getCourse?_t=1585396271169&csrfToken=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOjAsImV4cCI6MTc3MTU2NjMxNCwiaWF0IjoxNTgyMTc3NTE0fQ.iBmGtQ0fasTTaSuApywmN6Ms0aNYwUvkGLoXX6V6hO8",
                method:"get",
                params: {
                   educationCourseId:this.$route.query.id
                }   
            }).then((ok)=>{
                this.arr=ok.data.data
                this.introduces=this.arr.introduces
                window.console.log(ok)
                //window.console.log(this.introduces)
            })
        },
    //      getParams:function(){
    //         // 取到路由带过来的参数
    //         var courseId= this.$route.query.educationCourseId;
    //         // 将数据放在当前组件的数据内
    //         this.courseId = courseId
    //        // window.console.log(this.courseId)
    //   },
    }
}
</script>

<style scoped>
    .box{width: 90%;margin:0.2rem auto;}
    .top video{width: 100%;}
    .top p{font-weight: bold;word-wrap:wrap;}
    .indroduce .title{font-weight: bold;font-size: .2rem}
    .title{margin: .06rem 0}
</style>